import { request, config } from 'utils'
import * as commonService from 'services/common4Report'

const { api } = config
const { report } = api

export async function query(params) {
  params.apiBaseUrl = `${report}`;
  return commonService.commonQuery(params);
}

export async function listLogs(params = {}) {
  const url = `${report}/log/list/30/1/createTime/DESC/complex`
  return request({ url: url, method: 'put', data: params })
}

export async function doReportBy(id, params = {}) {
  const url = `${report}/doReport/${id}`
  return request({ url: url, method: 'get', responseType: 'blob', data: params })
}
